<style>
	#tpl-login-content{ position:relative;}
	.am-field-error, .am-form-error .am-form-field{
		-webkit-box-shadow: inherit;
		box-shadow: inherit;
	}
	.am-field-valid, .am-form-success .am-form-field {
		border-color: #5eb95e!important;
		-webkit-box-shadow: inherit;
		box-shadow: inherit;
	}
</style>
<div class="login-page">
	<!--<div class="header-login"><a class="logo" href="javascript:;"></a></div>-->
    <div id="tpl-login-content">
        <div class="wrap-login">
            <div class="slider-text">
                <dl class="items ms1">
                    <dt>助力眼镜行业数字化转型</dt>
                    <dd>从采购到零售一条龙智能管理</dd>
                    <dd>加速数字化转型的步伐</dd>
                    <dd>互联网+模式下打造的全新数字化管理系统</dd>
                </dl>
            </div>
            <div class="form-inner">
                <h1 class="title-login">用户登录</h1>
                <form id="loginForm" data-am-validator>
                    <input type="hidden" name="_xsrf" value="{{.xsrf_token}}" />
                    <div class="formbox" >
                        <div class="items"><i class="type mobile"></i><input id="user-name" name="UserName" required type="text" placeholder="请输入账号"></div>
                        <div class="items mb20"><i class="type lock"></i><input id="user-pwd" name="UserPwd" required type="password" placeholder="请输入密码"></div>
                        <div class="items"><button type="submit" class="submit-btn">登录</button></div>
                    </div>
                </form>
                <div class="tools-bar"></div>
            </div>
        </div>
        <div class="footer-default">
            <ul>
                <li>© 2018-2020 aheye.cn 版权所有 ICP证：皖ICP备12005532号-2</li>
                <li class="ml10"><a href="http://www.aheye.cn">返回官网</a></li>
                <li><a href="javascript:void(0)">法律声明及隐私权政策</a></li>
                <li><a href="http://www.aheye.cn">联系我们</a></li>
            </ul>
        </div>
    </div>
</div>
{{template "shared/globaljs.html"}}
<script language="javascript">
	$(function(){
		centervertical(document.getElementById('tpl-login-content'));
		
	});
	window.onresize=function  () {
		centervertical(document.getElementById('tpl-login-content'));
	}
	function centervertical(ele) {
		var eleH = ele.offsetHeight;
		var eleW = ele.offsetWidth;
		var height = client().height;
		var top = (height - eleH) / 2;
		ele.style.top = top + 'px';
	}

	function client(){
		if(window.innerWidth){
			return {
				"width":window.innerWidth,
				"height":window.innerHeight
			};
		}else if(document.compatMode === "CSS1Compat"){
			return {
				"width":document.documentElement.clientWidth,
				"height":document.documentElement.clientHeight
			};
		}else{
			return {
				"width":document.body.clientWidth,
				"height":document.body.clientHeight
			};
		}
	}
	$("#loginForm").validator({
		submit: function() {
			if(this.isFormValid()) {
				$.post('{{ urlfor "LoginController.DoLogin" }}', $("#loginForm").serialize(), function(e) {
					if(e.code == 0){
                        location = '{{ urlfor "HomeController.Index" }}';
					} else {
						layer.msg(e.msg)	
					}
				},"json") 
			}
			return false;
	  }
	});
</script>